﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteSauces.Master" AutoEventWireup="true" CodeBehind="FrmCliente.aspx.cs" Inherits="Sauces.Web.Caja.FrmCliente" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contenedor" runat="server">
    <fieldset>
      <legend> </legend>

        <asp:FormView 
        ID="fvCliente"
        ItemType="Sauces.Bussinees.Entities.Caja.Cliente" 
        DefaultMode="Edit"
        SelectMethod="getClienteByid"
        UpdateMethod="UpdateCliente"
        InsertMethod="AddCliente"
        runat="server" >

        <EditItemTemplate>        

            <table>
                
                <tr>
                    <td><asp:TextBox id="txtId" Text="<%# BindItem.Id %>" Visible="false" runat="server" /></td>
                </tr>

                <tr>
                    <td>Nombre</td>
                    <td><asp:TextBox id="txtNombre" Text="<%# BindItem.Nombre %>" runat="server" /></td>
                </tr>

                <tr>
                    <td>Apellidos</td>
                    <td><asp:TextBox id="txtApellidos" Text="<%# BindItem.Apellidos %>" runat="server" /></td>
                </tr>

                <tr>
                    <td>DNI</td>
                    <td><asp:TextBox id="txtDNI" Text="<%# BindItem.Dni %>" runat="server" /></td>
                </tr>

                <tr>
                    <td>Telefono</td>
                    <td><asp:TextBox id="txtTelefono" Text="<%# BindItem.Telefono%>" runat="server" /></td>
                </tr>

                <tr>
                    <td>RUC</td>
                    <td><asp:TextBox id="txtRuc" Text="<%# BindItem.Ruc %>" runat="server" /></td>
                </tr>

                <tr>
                    <td>Razon Social</td>
                    <td><asp:TextBox id="txtRazonSocial" Text="<%# BindItem.RazonSocial %>" runat="server" /></td>
                </tr>

                <tr>
                    <td>Direccion</td>
                    <td><asp:TextBox id="txtDireccion" Text="<%# BindItem.Direccion%>"  runat="server" /></td>
                </tr>

                <tr>
                    <td colspan="2">
                        <asp:Button ID="btnGuardar" Text="Guardar" CommandName="Update" runat="server"  OnClientClick="return confirm('ESTA SEGURO QUE DESEA GUARDAR LOS CAMBIOS?');"/>
                    </td>
                </tr>
            </table>
            <asp:ValidationSummary ID="validarCliente" runat="server" ShowModelStateErrors="true" ForeColor="Red" />
        </EditItemTemplate>
        <InsertItemTemplate>
            <table>
                <tr>
                    <td><asp:TextBox id="txtId" Text="<%# BindItem.Id==0 %>" Visible="false" runat="server" /></td>
                </tr>

                <tr>
                    <td>Nombre</td>
                    <td><asp:TextBox id="txtNombre" Text="<%# BindItem.Nombre %>" runat="server" /></td>
                </tr>

                <tr>
                    <td>Apellidos</td>
                    <td><asp:TextBox id="txtApellidos" Text="<%# BindItem.Apellidos %>" runat="server" /></td>
                </tr>

                <tr>
                    <td>DNI</td>
                    <td><asp:TextBox id="txtDNI" Text="<%# BindItem.Dni %>" runat="server" /></td>
                </tr>

                <tr>
                    <td>Telefono</td>
                    <td><asp:TextBox id="txtTelefono" Text="<%# BindItem.Telefono%>" runat="server" /></td>
                </tr>

                <tr>
                    <td>RUC</td>
                    <td><asp:TextBox id="txtRuc" Text="<%# BindItem.Ruc %>" runat="server" /></td>
                </tr>

                <tr>
                    <td>Razon Social</td>
                    <td><asp:TextBox id="txtRazonSocial" Text="<%# BindItem.RazonSocial %>" runat="server" /></td>
                </tr>

                <tr>
                    <td>Direccion</td>
                    <td><asp:TextBox id="txtDireccion" Text="<%# BindItem.Direccion%>" runat="server" /></td>
                </tr>

                <tr>
                    <td colspan="2">
                        <asp:Button ID="btnGuardar" Text="Guardar" CommandName="Insert" runat="server" OnClientClick="return confirm('ESTA SEGURO QUE DESEA GUARDAR EL CLIENTE?');" />
                    </td>
                </tr>
            </table>
            <asp:ValidationSummary ID="validarCliente" runat="server" ShowModelStateErrors="true" ForeColor="Red" />
        </InsertItemTemplate>
    </asp:FormView>
                

   </fieldset>
    
</asp:Content>
